1 package mobisnap.mobile_trx;
2
3 import mobisnap.common.reservation.*;
4
5 /***
6 * Used to represent variables and constants internally
7 */
8 public abstract class MSQLTVariable
9 implements MSQLTName
10 {
11 protected boolean notnull, constant;
12 protected Object value;
13 protected ReservationUseBase rsrv;
14
15 public MSQLTVariable( boolean constant, boolean notnull) {
16 this.constant = constant;
17 this.notnull = notnull;
18 }
19
20 /***
21 * Associates the given reservation to the current value of the variable
22 */
23 public void associateRsrv( ReservationUseBase rsrv) {
24 this.rsrv = rsrv;
25 }
26
27 /***
28 * Returns the reservations associated with the given variable
29 */
30 public ReservationUseBase getRsrv() {
31 return rsrv;
32 }
33
34
35 /***
36 * Returns the value of the variable
37 */
38 public Object getValue() {
39 if( value == null)
40 return SQLNull.getInstance();
41 else
42 return value;
43 }
44
45 /***
46 * Returns the value of the variable
47 */
48 public Object getValue( Object[] params) throws Exception {
49 throw new mobisnap.MobisnapException( "Variables do not have parameters");
50 }
51
52 /***
53 * Sets the value of the given variable
54 */
55 public abstract void setValue( Object obj) throws Exception;
56
57 public String toString() {
58 if( value != null)
59 return value.toString();
60 else
61 return "null";
62 }
63 }
This page was automatically generated by Maven